<div class="confirm-order pd10">
  <form action="__CONTROLLER__/confirmOrderPost" method="post">
    
    <section class="order-item">
      <a class="db" href="{:U('DeliverAddress/deliverAddressList','sid='.$sid)}?buyUrl={$buyUrl}">
        <empty name="order.address">收货地址：
        <else />
        <input type="hidden" name="addressId" value="{$order.address.id}">
        <div class="ms-list info"><span>收货信息：</span><p><b>{$order.address.name}</b>&nbsp;&nbsp;{$order.address.tel}</p></div>
        <div class="ms-list address"><span>收货地址：</span><p>{$order.address.provinceName}&nbsp;{$order.address.cityName}&nbsp;{$order.address.areaName}&nbsp;{$order.address.address}</p></div> 
        </empty>
        <span class="arrows9"></span>
      </a>
    </section>
    
    <section class="order-item delivery-type">
      <span>配送方式：</span>
      <div style="margin-bottom:5px;"><select id="delivery-type" name="shipping_way">{$order.shippingOptions}</select></div>
      <span>支付方式：</span>
      <div><select id="pay-apitype" name="apitype">{$order.productPayApiOptions}</select></div>
    </section>
    
    <section class="order-item">
      <span>商品信息：</span>
      <volist name="order.orderItems" id="vo">
      <volist name="vo.items" id="vo_attr">
      <div class="good-info">
        <a class="good-pic"><img src="{$vo_attr.pic}"></a>
        <div class="info-item">
          <p>{$vo.name}</p>
          <p><span class="key">规格： <foreach name="vo_attr.attrs" item="vo1" key="k">{$k}:{$vo1}&nbsp;&nbsp;</foreach></span></p>
          <p><span class="key sub-price" data-subprice="{$vo_attr.productPrice}">单价：￥{$vo_attr.productPrice}</span> <span class="key">数量：</span>{$vo_attr.quantity}</p>
        </div>
      </div>
      </volist>
      </volist>
    </section>
    
    <div id="total-price" class="price">订单总额：￥<span>{$order.totalPrice}</span></div>
    <input type="hidden" name="orderNo" value="{$order.orderNo}">
    <input type="hidden" name="sid" value="{$sid}">
    <button type="submit" class="btn btn-orange w100">提交订单</button>
    
  </form>
</div>

<script type="text/javascript">
  (function(){
	  //选择配送方式更改订单总金额
	  var oDeliveryType = document.getElementById ( "delivery-type" ),
	      oTotalPrice = document.getElementById ( "total-price" ), 
	      orderJSON = {$orderJSON};
	  
	  oDeliveryType.addEventListener ( "change", function(){
		  var totalPrice = orderJSON.shippingTotalPrice[this.value].price + orderJSON.goodsTotalPrice;
		  oTotalPrice.innerHTML = "订单总额：￥" + totalPrice;
	  }, false );
  })();
</script>
